<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/elecPrinter/elecPrinterStation.js"></script>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>运营管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>打印机站点</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

    var has_add = '';
    var has_edit = '';
    var has_delete = '';
</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <div class="pull-left search col-md-1">
                        <button type="button" class="btn  btn-primary" onclick="elecPrinterStation.showModel()">
                            添加站点
                        </button>
                    </div>
                </div>


                <%--  增加打印机站点模态框  --%>
                <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
                     aria-labelledby="exampleModalLabel">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                        aria-hidden="true"></span></button>
                                <h4 class="modal-title" id="exampleModalLabel" data-dismiss="modal" aria-label="Close">
                                    关闭</h4>
                            </div>
                            <div class="modal-body">
                                <form id="contentForm" class="layui-form">
                                    <input type="hidden" class="form-control" id="printerId"
                                           value="${elecPrinter.printerId}" name="printerId">
                                    <div class="form-group row">
                                        <label class="col-sm-4 col-form-label text-right">打印机名称:</label>
                                        <div class="col-sm-8">
                                            <input class="form-control" id="printerName" name="printerName"
                                                   value="${elecPrinter.printerName}" readonly>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-sm-4 col-form-label text-right">打印机逻辑地址:</label>
                                        <div class="col-sm-8">
                                            <input class="form-control" id="printerRtua" name="printerRtua"
                                                   value="${elecPrinter.printerRtua}" readonly>
                                        </div>
                                    </div>

                                    <div class="form-group row">
                                        <label class="col-sm-4 col-form-label text-right">站点名称*:</label>
                                        <div class="col-sm-8">
                                          <select id="elecStationId" name="elecStationId">
                                              <option value="">站点名称</option>
                                              <c:forEach items="${elecStations}" var="elecStation">
                                                  <option value="${elecStation.elecStationId}">${elecStation.stationName}</option>
                                              </c:forEach>
                                          </select>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                <button type="button" class="btn btn-success" id="addElecPrinter">确定添加</button>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <table id="exampleTable" data-mobile-responsive="true">
            </table>

        </div>
    </div>
</div>

<script type="text/javascript">

    $(function () {
        $('#elecStationId').searchableSelect();
    })

    elecPrinterStation.init();
</script>
</body>
</html>